#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int t, n;

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> t;
    while (t--)
    {
        cin >> n;
        if (n % 3 == 1)
            cout << (n + 2) / 3 << ' ' << (n - 1) / 3 << endl;
        else if (n % 3 == 2)
            cout << (n - 2) / 3 << ' ' << (n + 1) / 3 << endl;
        else
            cout << n / 3 << ' ' << n / 3 << endl;
    }
    return 0;
}